import request from './request'

const baseURL = import.meta.env.VITE_API_URL

export const commentAPI = { 
    createComment(data) { 
        return request.post(baseURL + '/comments', { 
            content: data.content,
            postId: data.postId,
        })
    },
    deleteComment(commentId) { 
        return request.delete(baseURL + '/comments/' + commentId)
    },
    getCommentById(commentId) { 
        return request.get(baseURL + '/comments/' + commentId)
    },
    getCommentsByPostId(postId) { 
        return request.get(baseURL + '/comments/post/' + postId)
    },
    likeComment(commentId) { 
        return request.put(baseURL + '/comments/like/' + commentId)
    }

}